#!/bin/bash
read -p "Please input need check ipaddress region:(example:xx.xx.1.)" IP
for i in `seq 254`
do
/bin/ping -c2 $IP$i >/dev/null0 2>&1
if [ $? -eq 0 ];then
        echo "$IP$i is up">>/tmp/uplist.log
else
        echo "$IP$i is down">>/tmp/downlist.log
fi
done